package com.hzit.controller;

import com.hzit.entity.Classes;
import com.hzit.entity.R;
import com.hzit.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Controller
@RequestMapping("/classes")
public class ClasserController {
	@Autowired
	private ClassesService classesService;
	//1. 查询所有班级
	@GetMapping("/list")
	@ResponseBody
	public R list(){
		List<Classes> classes = classesService.findAll();
		return R.ok(classes);
	}
}
